import 'package:get/get.dart';
import 'package:smart_ai_dart/utils/log_utils.dart';

class MainController extends GetxController {
  final currentIndex = 0.obs;

  void changePage(int index) {
    currentIndex.value = index;
  }

  @override
  void onInit() {
    super.onInit();
    if (Get.arguments != null) {
      final args = Get.arguments as Map<String, dynamic>;
      currentIndex.value = args['tab_index'];
      LogUtils.shared.d('User Data: ${args['username']}');
    }
  }
}
